package backend.majiong.yaku.yaku;

import backend.MainGame;
import backend.majiong.Pai;
import backend.majiong.Player;
import backend.majiong.yaku.AbstractYaku;
import backend.majiong.yaku.HandCombo;

public class Honitu extends AbstractYaku {

    @Override
    public boolean checkYaku(Player player, HandCombo combo, MainGame mainGame) {
        Integer checkType = null;
        // 顺子
        for (Pai pai : combo.getAllHandPai()) {
            if (Pai.TYPE_ZI.equals(pai.getType())) {
                continue;
            }
            if (checkType == null) {
                checkType = pai.getType();
            } else if (!checkType.equals(pai.getType())) {
                return false;
            }
        }
        return true;
    }

    @Override
    public String getYakuName() {
        return "混一色";
    }

    @Override
    public Integer getYakuNum(boolean isMenQing) {
        if(isMenQing) {
            return 3;
        }
        return 2;
    }

}
